﻿@using AddressBookDev.ViewModels
@model ContactsListViewModel
@{
    ViewBag.Title = "Home Page";
}
<div class="contacts_container">
    @using (Html.BeginForm("DeleteContacts", "Home", FormMethod.Post))
    {
        if (Model.Contacts.Count > 0)
        {
            <div class="contacts_bar">
                <input id="delete_btn" type="submit" value="Delete"/>
            </div>
        }
        <div id="contacts">
            <table class="contacts_table">
                <tbody>
                    @foreach (ContactViewModel contact in Model.Contacts)
                    {
                        <tr>
                            <td><img src="@Url.Content(contact.Picture)" alt="@contact.Name" class="thumbnail_img" data-width="@contact.PicWidth" data-height="@contact.PicHeight"/></td>
                            <td>@Html.CheckBox("fordelete", new {value = contact.Id})</td>
                            <td>@Html.ActionLink(contact.Name, "Contact", "Home", new {id = contact.Id}, new {Class = "list_name"})</td>
                            <td><span>@contact.Phone</span></td>
                            <td><span>@contact.Email</span></td>
                            <td><span>@contact.Address</span></td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    }
</div>
